
(function(){var validationApp = angular.module('registrationForm', []);
// create angular controller
	validationApp.controller('regFormController', ['$scope','$http',function($scope,$http) {
		$scope.AddUser = function(){
			
			$scope.data = {Username: 	$scope.Username,
						   Password: 	$scope.Password,
						   Nickname: 	$scope.Nickname,
						   PhotoURL: 	$scope.Photo,
						   Description: $scope.Description};
			$scope.Username = "Avner";
			$http.post("/FinelProject/InsertUserInToTable",$scope.data) 
			.then(function(){
				$scope.Username = "Gidron";
			});
			//$scope.Username = "Avner";
		};
		$scope.reset = function() {
			$scope.Username = '';
			$scope.Password='';
			$scope.Nickname='';
			$scope.Photo='';
			$scope.Description='';
	        
	      };
	}]);
})();